//
//  LeftTableViewCell.m
//  Stop
//
//  Created by dllo on 16/3/5.
//  Copyright © 2016年 徐宏飞. All rights reserved.
//

#import "LeftTableViewCell.h"

#define GAP 100

@interface LeftTableViewCell ()

@property (nonatomic, weak) UIImageView *imageV;
@property (nonatomic, weak) UILabel *userLabel;
@property (nonatomic, weak) UIImageView *imageM;



@end



@implementation LeftTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}





- (void)createSubViews{
    
    //
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(20 + GAP, 15, 25, 25)];
  
    [self.contentView addSubview:imageV];
    self.imageV = imageV;
    
    //文字
    UILabel *userLabel = [[UILabel alloc] initWithFrame:CGRectMake(60 + GAP, 15, 200, 25)];
    userLabel.text = @"您好:1213456664";
    userLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:userLabel];
    self.userLabel = userLabel;
    
    
    UIImageView *imageM = [[UIImageView alloc] initWithFrame:CGRectMake(200 + GAP, 15, 25, 25)];
    self.imageM = imageM;
    [self.contentView addSubview:self.imageM];
    
}




-(void)setModel:(LeftCellModel *)model{
    _model = model;
    
    //头像
    self.imageV.image = [UIImage imageNamed:model.icon_name];
    
    //文字
    self.userLabel.text = model.tilte;
    
    //更多的按钮
    switch (model.moreImageType) {
            
        case clickTypeNone: //没有图
            
            break;
        case clickTypeAdd:  //加号图
            self.imageM.image = [UIImage imageNamed:@"iconfont-jikediancanicon09"];
            
            break;
        case clickTypeMore: //更多图
            self.imageM.image = [UIImage imageNamed:@"iconfont-more-3"];
    
            break;
            
        default:
            break;
    }
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


@end
